package com.assessment.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.assessment.entity.Account;
import com.assessment.service.AccountService;



@Controller
@RequestMapping("/login")
public class AccountController {
	@Resource
	private AccountService accountService;
	
	@RequestMapping("/toLogin.do")
	public String toLogin(){
		return "login";
	}
	
	@RequestMapping("/login")
	public String login(Account account){
		Account account2=accountService.login(account);
		if(account2==null){
			return "login";
		}else{
			return "staff/shouye";
		}
	}
	
	@RequestMapping("/shouye")
	public String back(){
		return "staff/shouye";
	}
}
